<#import "/META-INF/spring.ftl" as spring />
<#import "/META-INF/mspring.ftl" as mspring />
<#include "/WEB-INF/views/admin/inc/header.ftl" />
	<div id="error" class="message error" style="display:none;"></div>
	<form id="postForm" name="postForm" action="${base}/admin/spider/post/edit/save" method="POST">
		<@spring.bind "spiderPost" />
		<@spring.formHiddenInput path="spiderPost.id" />
		<@spring.formHiddenInput path="spiderPost.spiderRule" />
		<@spring.formHiddenInput path="spiderPost.createTime" />
		<@spring.formHiddenInput path="spiderPost.posted" />
		<@spring.formHiddenInput path="spiderPost.postTime" />
		<table class="formtable">
			<tr>
				<td class="fieldlabel" style="width:60px;">标题</td>
				<td colspan="3">
					<@spring.formInput path="spiderPost.title" attributes='class="textinput" style="width:99%;" validate=\'{required:true, messages:{required:"请输入文章标题"}}\'' />
				</td>
			</tr>
			<tr>
				<td class="fieldlabel">
					内容<br/>
					<a href="javascript:displayToggle();" style="font-weight: bold; color:red;">插入附件</a><br/>
				</td>
				<td colspan="3">
					<@spring.formTextarea path="spiderPost.content" attributes='style="height:400px;width:100%;"' />
				</td>
			</tr>
			<tr>
				<td colspan="4" style="text-align:center;">
					<input type="submit" class="btn" value=" 保存修改 " />
					<input type="button" class="btn" style="color:red;" value=" 发布 " />
				</td>
			</tr>
		</table>
	</form>
	<script type="text/javascript">
		$(document).ready(function(){
			//斑马线
			var tables=document.getElementsByTagName("table");
			var b=false;
			for (var j = 0; j < tables.length; j++){
				var cells = tables[j].getElementsByTagName("tr");
				//cells[0].className="color3";
				b=false;
				for (var i = 0; i < cells.length; i++){
					if(b){
						cells[i].className="color2";
						b=false;
					}
					else{
						cells[i].className="color3";
						b=true;
					};
				};
			}
			
			mlog.editor.init({
				model : "all",
				id : "content"
			});
			
			mlog.form.validate({
				selector : "#postForm",
				errorLabelContainer : "#error",
				wrapper: 'li',
				onfocusout : false,
				onkeyup : false,
				onclick : false,
				success : function(){
					mlog.utils.scrollTop();
				}
			});
		});
	</script>
<#include "/WEB-INF/views/admin/inc/footer.ftl" />